// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
})


exports.main = async (event, context) => {
  {
    const { w, h } = event
    console.log("长方形的周长与面积", [(w + h) * 2, w * h])

    return {
      circum: (w + h) * 2,
      area: w * h
    }
  }
}